package org.smr.ministore.service.impl;

import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.blade.dao.base.BaseMapper;
import org.blade.msg.ErrorCode;
import org.blade.utils.IdGenUtils;
import org.blade.utils.Pager;
import org.blade.service.base.AbstractService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smr.ministore.dao.GoodsSpecificationMapper;
import org.smr.ministore.dao.GoodsSpecificationOrganMapper;
import org.smr.ministore.entities.GoodsSpecification;
import org.smr.ministore.entities.GoodsSpecificationOrgan;
import org.smr.ministore.entities.vo.Assign2OrganVO;
import org.smr.ministore.entities.vo.Assign2OrgansVO;
import org.smr.ministore.service.GoodsSpecificationService;

import org.springframework.beans.factory.annotation.Autowired;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("goodsSpecificationServiceFacade")
public class GoodsSpecificationServiceFacade extends AbstractService<Long,GoodsSpecification> implements GoodsSpecificationService {


    private static Logger logger = LoggerFactory.getLogger(GoodsSpecificationServiceFacade.class);

    @Resource(name = "goodsSpecificationServiceImpl")
    private GoodsSpecificationService service;

    @Autowired
    public GoodsSpecificationServiceFacade(GoodsSpecificationMapper mapper) {
        super(mapper);
    }


    public int save(GoodsSpecification entity) {

        return service.save(entity);
    }

    public int updateById(GoodsSpecification id) {

        return service.updateById(id);
    }

    public GoodsSpecification queryById(Long id) {

        return service.queryById(id);
    }

    public int deleteById(Long id) {
        return service.deleteById(id);
    }

    public Pager<GoodsSpecification> paginate(GoodsSpecification entity, Long pageSize, Long pageNum) {

        return paginate(entity, pageSize, pageNum);
    }

    public int batchSave(List<GoodsSpecification> entities) {
        this.batchSaveAttatch(entities);
        return service.batchSave(entities);
    }


    public int batchModify(List<GoodsSpecification> entities) {
        this.batchModifyAttatch(entities);
        return service.batchModify(entities);
    }


    public int deleteByIdLogical(Long id) {
        return service.deleteByIdLogical(id);
    }


    public int assign(Assign2OrganVO assign2Organ) {
        return this.service.assign(assign2Organ);
    }

    @Transactional(readOnly = true)
    public GoodsSpecification queryByPrimaryKey(GoodsSpecification goodsSpecification) {
        return service.queryByPrimaryKey(goodsSpecification);
    }

    public int assign(Assign2OrgansVO assignee) {
        return this.service.assign(assignee);
    }


    public Long getId() {
        return IdGenUtils.getNextLongId();
    }
}
